package com.micro.ai.auth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 权限DTO
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@Schema(description = "权限信息")
public class PermissionDTO {
    
    @Schema(description = "权限ID")
    private String id;
    
    @Schema(description = "权限编码", example = "user:view")
    private String code;
    
    @Schema(description = "权限名称", example = "查看用户")
    private String name;
    
    @Schema(description = "权限描述")
    private String description;
    
    @Schema(description = "权限类型", example = "button", allowableValues = {"menu", "button", "api", "data"})
    private String type;
    
    @Schema(description = "资源路径", example = "/api/users")
    private String resource;
    
    @Schema(description = "操作动作", example = "read")
    private String action;
    
    @Schema(description = "父权限ID")
    private String parentId;
    
    @Schema(description = "权限层级")
    private Integer level;
    
    @Schema(description = "排序")
    private Integer sortOrder;
    
    @Schema(description = "状态", allowableValues = {"active", "inactive"})
    private String status;
    
    @Schema(description = "关联的菜单ID列表")
    private List<String> relatedMenuIds;
    
    @Schema(description = "关联的菜单名称列表")
    private List<String> relatedMenuNames;
    
    @Schema(description = "子权限列表")
    private List<PermissionDTO> children;
    
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;
    
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
}
